﻿using Lightworks.Core.Entity;
using Lightworks.System.Models;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lightworks.System.Dto
{

    public class AddUserReq : UpdateUserReq
    {
        [Required]
        public string? Password { get; set; }
    }

    public class UpdateUserReq : BaseEntity
    {
        public long Id { get; set; }
        [Required]
        public string? UserName { get; set; }
        [Required]
        public string? Name { get; set; }
        public string? Gender { get; set; }
        public string? Avatar { get; set; } = "/img/avatar.jpg";
        public string? Salt { get; set; }
        public long DeptId { get; set; }
        public bool IsSuper { get; set; }
        public string? Status { get; set; }
        public long[]? RoleIds { get; set; } = [];
        public long[]? DeptPath { get; set; } = [];
    }

    public class UserSearchReq : SearchReq 
    {
        public long DeptId { get; set; }
    }

    public class UserRes : BaseEntity 
    {
        public string? UserName { get; set; }
        public string? Name { get; set; }
        public string? Gender { get; set; }
        public string? Avatar { get; set; }
        public long DeptId { get; set; }
        public bool IsSuper { get; set; }
        public string? Status { get; set; }
        public string? DeptName { get; set; }
        public long[]? DeptPath { get; set; }
        public long[]? RoleIds { get; set; }
        public string? RoleNames { get; set; }
    }
}
